import request from '@/utils/request'

let fileUrl='/common/datasource'

export function listFiles(query) {
    return request({
        url: fileUrl+'/file/listLimit',
        method: 'get',
        params: query
    })
}

export function uploadFile(data) {
    return request({
        url: fileUrl+'/file/upload',
        method: 'post',
        data: data
    })
}

export function getTopData(params) {
    return request({
      url: '/common/datasource/file/getTopData',
      method: 'get',
      params: params
    })
}

export function convertType(data) {
    return request({
        url: fileUrl+'/file/convertType',
        method: 'post',
        data: data
    })
}

export function storeFileData(data) {
    return request({
        url: fileUrl+'/file/parseAndStore',
        method: 'post',
        data: data
    })
}

export function getColumns(params) {
    return request({
        url: fileUrl+'/file/getColumns',
        method: 'get',
        params: params
    })
}

export function deleteFile(params) {
    return request({
        url: fileUrl+'/file/delete',
        method: 'get',
        params: params
    })
}
  
  